﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Top.ascx.cs" Inherits="GUI.Controls.Shared.Top" %>
<div class="w980 wp relative clearfix">
    <div class="header1ct wp">
        <ul>
            <li class="active"><asp:Literal runat="server" id="ltrHeading"></asp:Literal></li>
            <li><a target="_blank" href="http://afamily.vn/" title="gia đình">Afamily</a></li>
            <li><a target="_blank" href="http://kenh14.vn/" title="giải trí">Kenh14</a></li>
            <li><a target="_blank" href="http://autopro.com.vn/" title="tin ô tô">Autopro</a></li>
            <li><a target="_blank" href="http://genk.vn/" title="tin công nghệ">GenK</a></li>
        </ul>
        <div class="fr">
            <div class="fr search-container sprite">
                <input type="text" class="text" id="textSearch" />
                <input type="button" class="button" />
            </div>
            <div id="divLoginInfo" class="fr" style="display: none">
                <span id="idNameMing" style="font-weight: bold; float: left;"></span><span id="mingid_notification" class="mingid_notification" style="float: left;"></span>| <a id="lnkLogOut" onclick="openLogout();" style="cursor: pointer; font-weight: bold;">Thoát</a>
            </div>
            <div id="divLogin" class="fr">
                <a id="lnkLoginMing" onclick="openLogin(); return false;" href="javascript:void(0);">Đăng nhập</a></div>
        </div>
    </div>
</div>
<script type="text/javascript">
    CheckSession();
    var currentActive = $(".header1ct ul li.active");
    $(".header1ct ul li:not(.active)").hover(
            function () {
                currentActive.toggleClass("active");
                $(this).addClass("active");
            },
            function () {
                currentActive.toggleClass("active");
                $(this).removeClass("active");
            }
        );

    $(".search-container .button").click(function () {
        var strSearch = $('#textSearch').val();
        strSearch = encodeURIComponent(strSearch);
        if (strSearch != '') {
            var url = String.format("/tim-kiem.htm?keywords={0}", strSearch);
            if (document.all) {
                window.location.href = url;
            }
            else {
                document.location.href = url;
            }
        } else {
            $('#textSearch').focus();
        }
        return false;
    });

    $('#textSearch').keypress(function (event) {
        var key;
        if (window.event) {
            key = window.event.keyCode;
        }
        else {
            key = event.which;
        }
        if (key == 13) {
            $(".search-container .button").click();
            return false;
        }
    });

</script>
